<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fo="http://www.w3.org/1999/XSL/Format"
  version="1.0" >

<!-- rule for the whole document: root element is page -->

<xsl:template match="base">
    <xsl:apply-templates select="title"/>
</xsl:template>

<!-- A series of XSLT rules that produce fo:blocks to be inserted above -->

 <xsl:template match="base/title">
    <xsl:apply-templates select="../pizza"/>
</xsl:template>
  


 <xsl:template match="pizza">
<ul>
<xsl:element name="pizza">
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
    <xsl:value-of select="@name"/>

    
   <xsl:text> ( </xsl:text>
    <xsl:for-each select="ingredient">
         <xsl:apply-templates select="."/>
    </xsl:for-each>
<xsl:text>) pour </xsl:text><xsl:value-of select="@price"/><xsl:text> euros!!</xsl:text>
</xsl:element>
</ul>
    
  </xsl:template>

  

 <xsl:template match="ingredient">
<li><xsl:value-of select="."/></li>
</xsl:template>


</xsl:stylesheet>
